<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
  <title>Document</title>
  <style>
    body {
      background-color: #f9f9f9;
    }
    #back {
      background-color: #fff;
      padding: 30px;
      border: 1px solid #d8dee2;
      border-radius: 5px;
    }
    .container {
      margin-top: 50px;
    }
    .form-control {
      background-color: rgb(250, 255, 189);
    }
    #addFile {
      margin-top: 10px;
    }
  </style>
</head>

<body>
  <div class="container">
    <div class="row">
      <div class="col-md-4 col-md-offset-4" id="back">
        <form action="a.cgi" method="POST" enctype=multipart/form-data >
        <input type="hidden" name="number" value=3 />
          <div class="form-group">
            <div class="file-container" style="display:inline-block;position:relative;overflow: hidden;vertical-align:middle">
              <button class="btn btn-success fileinput-button" type="button">+</button>
              <input type="file" name="file1"  onchange="loadFile(this.files[0], 'input1')" style="position:absolute;top:0;left:0;font-size:34px; opacity:0"
                id="input1">
              <label class="checkbox-inline">
                <input name="checkbox1" type="checkbox" value="l"> -l
              </label>
              <label class="checkbox-inline">
                <input name="checkbox1" type="checkbox" value="w"> w
              </label>
              <label class="checkbox-inline">
                <input name="checkbox1" type="checkbox" value="c"> c
              </label>
            </div>
            <hr>
            <div class="file-container" style="display:inline-block;position:relative;overflow: hidden;vertical-align:middle">
              <button class="btn btn-success fileinput-button" type="button">+</button>
              <input type="file" name="file2" onchange="loadFile(this.files[0], 'input2')" style="position:absolute;top:0;left:0;font-size:34px; opacity:0"
                id="input2">
              <label class="checkbox-inline">
                <input name="checkbox2" type="checkbox" value="l"> -l
              </label>
              <label class="checkbox-inline">
                <input name="checkbox2" type="checkbox" value="w"> w
              </label>
              <label class="checkbox-inline">
                <input name="checkbox2" type="checkbox" value="c"> c
              </label>
            </div>
            <hr>
            <div class="file-container" style="display:inline-block;position:relative;overflow: hidden;vertical-align:middle">
              <button class="btn btn-success fileinput-button" type="button">+</button>
              <input type="file" name="file3" onchange="loadFile(this.files[0], 'input3')" style="position:absolute;top:0;left:0;font-size:34px; opacity:0"
                id="input3">
              <label class="checkbox-inline">
                <input name="checkbox3" type="checkbox" value="l"> -l
              </label>
              <label class="checkbox-inline">
                <input name="checkbox3" type="checkbox" value="w"> w
              </label>
              <label class="checkbox-inline">
                <input name="checkbox3" type="checkbox" value="c"> c
              </label>
            </div>
            <br>
            <button class="btn btn-primary" id="addFile" type="submit">+</button>
          </div>
        </form>
      </div>
    </div>
  </div>
</body>
<script>
  function loadFile(file, _id) {
    var id = "#" + _id;
    $(id).after(`<span style="vertical-align: middle">${file.name}</span>`)
  }
</script>

</html>
